﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;

namespace MTQ.DAL.DBView
{
   public class MSsqlExecute
    {
        
        public static int ExecuteNonQuery(string sql) {
            string sqlConnect = ConfigurationManager.ConnectionStrings["MTQFramework"].ToString();
            return SqlHelper.ExecuteNonQuery(sqlConnect, CommandType.Text, sql);             
        }

        public static DataTable ExecuteDataset(string sql)
        {
            string sqlConnect = ConfigurationManager.ConnectionStrings["MTQFramework"].ToString();
            DataSet ds = SqlHelper.ExecuteDataset(sqlConnect, CommandType.Text, sql);
            if (ds == null) {
                return new DataTable();
            }
            return ds.Tables[0];
        }
    }
}
